<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>继承</title>
</head>

<body>
  <script>
    let o = {}
    o.x = 1;
    o.y = 2
    let p = Object.create(o)
    p.x = 2
    console.log(p.y);
    console.log(p.x);
    console.log(o.x);
    let q = Object.create(p)
    console.log(q);
    q.z = 3
    let f = q.toString()
    console.log(f);
    console.log(q.x + q.y + q.z);
  </script>
</body>

</html>